<?php $this->load->view('layout/adminHeader'); ?>
    
    <div id="mainContent" class="floatFix">
    	<?php $this->load->view('layout/adminBookingsSubmenu'); ?>
        
    	<div class="lCol">
        	<?php $this->load->view('layout/flashdata'); ?>
            
           	<h2>Check user</h2>
			
			<p>This user is already in the database.</p>
            
			<form action="<?php echo site_url("bookings/check_user/".htmlspecialchars($data_serialized)); ?>" method="post">
			<?php if (isset($fields) && count($fields) > 0) {?>
			
				<p>List of changed elements :</p>
				
				<table>
					<tr><th>Field</th><th>Old value</th><th>New value</th><th>Select new value</th></tr>
					<?php foreach($fields as  $key => $field)
					{
					$values = explode(" | ",$field);
					$old_value = $values[1];
					$new_value = $values[0];
					?>			
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $old_value; ?></td>
						<td><?php echo $new_value; ?></td>
						<td><input type="checkbox" name="choice[]" id="choice[]" value="<?php echo $key." | ".$new_value; ?>" /></td>
					</tr>
					<?php } ?>
				</table>
			<?php } ?>
			
			<input type="submit" class="submitButton" value="Use this existing user" name="go_to_step3" id="go_to_step3" />
			<input type="submit" class="submitButton" value="Don't use it" name="go_to_step2" id="go_to_step2" />
			</form>

        
        </div>
        
        <div class="rCol">
        	<h2>Sidebar</h2>
        </div>
        
    </div>
    
<?php $this->load->view('layout/adminFooter'); ?>